<ui:composition template="/templates/contentTempl.xhtml"
	xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:a="http://richfaces.org/a4j" xmlns:r="http://richfaces.org/rich"
	xmlns:t="http://myfaces.apache.org/tomahawk">
	<ui:define name="title">Търсене на потребител</ui:define>
	<ui:define name="pageLabel">
		<f:view>
			<h:outputText value="Търсене на потребител" />
		</f:view>
	</ui:define>
	<ui:define name="topCenterSideContent">
		<a:keepAlive beanName="searchUsers" />
		<f:view>
			<h:form id="frmsearchObj">
				<h:panelGrid width="100%">
					<h:panelGrid columns="2">
						<h:outputText value="Потребителско име"></h:outputText>
						<h:inputText value="#{searchUsers.username}" />
						<h:outputText value="Име"></h:outputText>
						<h:inputText value="#{searchUsers.firstName}" />
						<h:outputText value="Фамилия"></h:outputText>
						<h:inputText value="#{searchUsers.family}" />
						<h:outputText value="ЕГН"></h:outputText>
						<h:inputText value="#{searchUsers.egn}" />
						<r:panel header="Групи">
							<h:outputText value="Избор на група" />
							<h:selectOneMenu value="#{searchUsers.selectedGroup}">
								<f:selectItems value="#{searchUsers.nomGroups}" />
							</h:selectOneMenu>
						</r:panel>
						<h:panelGrid styleClass="container-right">
							<a:commandButton id="btnId" value="Търсене на потребител"
								type="submit" action="#{searchUsers.search}"
								reRender="tblResults" />
						</h:panelGrid>
					</h:panelGrid>
					<h:panelGrid width="100%">
						<r:dataTable id="tblResults" width="100%" var="r" rows="10"
							onRowMouseOver="this.className='dataTableRowMouseOver'"
							onRowMouseOut="this.className='dataTableRowMouseOut'"
							rowKeyVar="selected" value="#{searchUsers.tableRows}">
							<f:facet name="header">
								<r:datascroller id="tblResDatascrollerHeader" />
							</f:facet>
							<r:column>
								<f:facet name="header">
									<h:outputText value="Потребителско име" />
								</f:facet>
								<h:outputText value="#{r.username}" />
							</r:column>
							<r:column>
								<f:facet name="header">
									<h:outputText value="Име" />
								</f:facet>
								<h:outputText value="#{r.firstName}" />
							</r:column>
							<r:column>
								<f:facet name="header">
									<h:outputText value="Фамилия" />
								</f:facet>
								<h:outputText value="#{r.family}" />
							</r:column>
							<r:column>
								<f:facet name="header">
									<h:outputText value="Егн" />
								</f:facet>
								<h:outputText value="#{r.egn}" />
							</r:column>
							<r:column>
								<f:facet name="header">
									<h:outputText value="Действие" />
								</f:facet>
								<h:panelGrid columns="3">
									<a:commandButton value="Промяна на потребител"
										action="#{searchUsers.navToEdit}"
										style="background-color:#EEE;border-color:#DDD;margin-right:5px;"
										id="button2">
										<f:setPropertyActionListener value="#{selected}"
											target="#{searchUsers.selectedRow}" />
									</a:commandButton>
								</h:panelGrid>
							</r:column>
						</r:dataTable>
					</h:panelGrid>
				</h:panelGrid>
			</h:form>
		</f:view>
	</ui:define>
</ui:composition>